package club.xinghe.biz;

import club.xinghe.dao.GradeDao;
import club.xinghe.entity.Grade;
import club.xinghe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * 说明:对年级进行操作的业务
 *
 * @姚文斌
 * @create 2019-09-28 下午 6:23
 */
public class GradeBiz {
    /**
     * 说明：查看年级
     * 姚家乐
     */
    public List<Grade> showGrade() {
        SqlSession session = SqlSessionFactoryUtil.getSqlSession();
        List<Grade> list = null;
        try {
            GradeDao gradeDao = session.getMapper(GradeDao.class);
            list = gradeDao.showGrade();
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            session.close();
        }
        return list;
    }
}
